package com.study.demo.aop.proxy.cglib;

import com.study.demo.aop.proxy.jdk.StudyService;

/**
 * jdk 代理
 * @author: elvin
 * @time: 2019-10-09 16:52
 * @desc:
 **/
public class Start {
    public static void main(String[] args) {
        StudyService study = new StudyService();
        System.out.println("---------没有cglib代理时------------");
        study.studyChinese("小明");
        study.studyEnglish("小明");

        StudyCGLIBProxy proxy = new StudyCGLIBProxy();
        StudyService studyProxy =(StudyService) proxy.createProxyObj(study.getClass());
        System.out.println("---------被cglib代理时------------");
        studyProxy.studyChinese("小明");
        System.out.println("--------------------------");
        studyProxy.studyEnglish("小明");
    }
}
